package com.squid.cloud.common.component;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;


@Component
@PropertySource(value = {"classpath:${system.env}/business.properties"}, ignoreResourceNotFound = true)
@ConfigurationProperties(prefix = "business")
@Data
public class BusinessProperties {

	private String index_page;

	private Payment payment = new Payment();

	private Invoice invoice = new Invoice();

	private Account account = new Account();
	
	private Redis redis = new Redis();
	
	private Baidu baidu = new Baidu();
	private Pingan pingan = new Pingan();
	private CouponRecharge couponrecharge = new CouponRecharge();

	@Getter
	@Setter
	public static class Invoice{
		private String notify_url;

		private String seller_merch_userId;

		//开电子发票，销货方标识
		String sellerIdentity;

		//开电子发票，加密key
		String key;
		
		// 发票请求开票成功，但是签章失败，多少分钟之后，将改发票标识为失败
		private int expiremin;
	}

	@Getter
	@Setter
	public static class Payment {
		// 支付账号
		private String parent_id;
		// 支付秘钥
		private String key;
		// 支付网关
		private String url;
		// 支付异步通知
		//private String notify_url;
		// 支付异步通知前缀
		private String notify_url_prefix;
		// 默认支付人
		private String default_payer;
		// 平台收款账户
		private String platform_payee_account;
	}

	@Getter
	@Setter
	public static class Account {
		//优惠账户
		private String coupon_account_id;
		//折扣账户
		private String discount_account_id;

		private String fee_account_id;
	}

	@Getter
	@Setter
	public static class Redis{
		//BIZ工程redis前缀
		private String biz_redis_prefix;
	}
	
	@Getter
	@Setter
	public static class Baidu{
		//百度地图key
		private String key;
	}
	
	@Getter
	@Setter
	public static class Pingan{
		// 平安好车主行业CODE
		private int hcz_industry_code;
		// 平安好车主赠送金额 分为单位
		private long hcz_gift_money;
		// 平安好车主充值金额必须大于等于此金额，才会进行赠送 分为单位
		private long hcz_gift_limit_money;
	}
	@Getter
	@Setter
	public static class CouponRecharge{
		// 充值失败次数
		private int charge_err_num;
	}

}
